@extends('app')

@section('content')
<script type="text/javascript">
function del(){

    if(confirm('是否删除角色？')){
        return true;
    }
}

</script>
<div class="row  border-bottom white-bg dashboard-header">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>权限列表</h5>
            <a class="btn btn-outline btn-success pull-right" href="{{url('perms/create')}}">添加权限</a>
        </div>
        <div class="ibox-content">

            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>权限</th>
                        <th>权限名称</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                @foreach($perms as $perm)
                    <tr>
                        <td>{{$perm->id}}</td>
                        <td>{{$perm->name}}
                        </td>
                        <td>{{$perm->display_name}}</td>
                        <td>
                            <a class="btn btn-outline btn-success pull-left" href="{{url('perms/'.$perm->id.'/edit')}}">修改</a>
                            <form class="pull-left" action="{{url('perms',$perm->id)}}" method="POST">
                            {!! csrf_field() !!}
                            <input type="hidden" name="_method" value="DELETE">
                                &nbsp;&nbsp;<button class="btn btn-outline btn-success role-del" onclick="del()">删除</button>
                            </form>
                        </td>
                    </tr>
                @endforeach
                </tbody>

            </table>
            <nav>{!! $perms->render() !!}</nav>
        </div>

        
    </div>
</div>

@stop